﻿using NHibernate.Mapping.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace IceZero.DataStore.Models
{
    /// <summary>
    /// 关联表，关联到ForeignModeModel，通过id一对一关联
    /// </summary>
    [Class(Table = "IceZeroTest_ForeignModeThird")]
    public class ForeignModeThirdModel
    {
        [Id(0, Name = "Id", TypeType = typeof(string),Length = 255)]
        [Key(1)]
        [Generator(2, Class = "foreign")]
        [OneToOne(Name = "Id",Constrained =true,ForeignKey ="Id",ClassType =typeof(ForeignModeModel))]
        public virtual string Id { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Property(Column = "CreateTime", TypeType = typeof(DateTime))]
        public virtual DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 备注
        /// </summary>
        [Property(Column = "Remark", TypeType = typeof(string), Length = 1000)]
        public virtual string Remark { get; set; }
    }
}
